package trading.ctm.yunjing.module.auction.adapter

import android.widget.LinearLayout
import android.widget.TextView
import cc.vv.lkbasecomponent.base.ui.adapter.LKBaseSingleAdapter
import cc.vv.lkbasecomponent.base.ui.adapter.viewholder.LKBaseViewHolder
import trading.ctm.yunjing.R

class AuctionListAdapter : LKBaseSingleAdapter<String, LKBaseViewHolder>{

    constructor(resId: Int, data: List<String>):super(resId, data)

    override fun convert(helper: LKBaseViewHolder?, item: String?) {
        super.convert(helper, item)

        helper!!.getView<TextView>(R.id.tv_aal_ranking).text = data[0]
        helper!!.getView<TextView>(R.id.tv_aal_offer).text = data[0]
        helper!!.getView<TextView>(R.id.tv_aal_offer_number).text = data[0]
        helper!!.getView<TextView>(R.id.tv_aal_offer_time).text = data[0]

        val view = helper.getView<LinearLayout>(R.id.ll_aal_ba)
        if(helper.adapterPosition % 2 == 0){
            view.setBackgroundResource(R.color.color_FBF7F5)
        } else {
            view.setBackgroundResource(R.color.color_FFFFFF)
        }
    }
}
